home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / exec / fungetch.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  477 b   |  32 lines

  1. /*
  2. \funcref{fun\_getch}{void fun\_getch ()}
  3.     {}
  4.     {}
  5.     {}
  6.     {fun\_gets()}
  7.     {fungetch.c}
  8.     {
  9.  
  10.         This function reads in one key and returns it in the {\em reg} return
  11.         register as an {\em e\_str} value.
  12.  
  13.     }
  14. */
  15.  
  16. #include "icm-exec.h"
  17.  
  18. void fun_getch ()
  19. {
  20.     static char
  21.         buf [200];
  22. #ifdef MSDOS
  23.     buf [0] = (char) getch ();
  24. #else
  25.     gets (buf);
  26.     buf [1] = '\0';
  27. #endif
  28.  
  29.     reg = newvar (e_str);
  30.     reg.vu.i->ls.str = xstrdup (buf);
  31. }
  32.